home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / game / patch / WHDIDemos.lzh / PygmyProjects_Extension.lha / ExtensionHD / Install < prev    next >
Text File  |  2000-05-12  |  4KB  |  206 lines

  1. ;****************************
  2.  
  3. (set #readme-file "README")    ;name of the readme file
  4.  
  5. (procedure P_MakeImages
  6.   (set #CI_disknum 1)
  7.   (set #CI_diskname ("%s Disk %ld" @app-name #CI_disknum))
  8.   (set #CI_disklen 901120)
  9.   (set #CI_skiptrk -1)
  10.   (P_CreateImage)
  11. )
  12.  
  13. ;****************************
  14. ;----------------------------
  15. ; checks if given program is installed, if not abort install
  16. ; #program - to check
  17.  
  18. (procedure P_ChkRun
  19.   (if
  20.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  21.     ("")
  22.     (abort 
  23.       (cat
  24.     "You must install \"" #program "\" first!\n"
  25.     "It must be accessible via the path.\n"
  26.     "You can find it in the WHDLoad package."
  27.       )
  28.     )
  29.   )
  30. )
  31.  
  32. ;----------------------------
  33. ; Create Image using DIC
  34. ; #dest        - path to save image in
  35. ; #CI_disknum  - number of the disk image to create
  36. ; #CI_diskname - label of the disk
  37. ; #CI_disklen  - length of disk image to create
  38. ; #CI_skiptrk  - track to skip, -1 means no skip
  39. ; #CI_drive    - drive to create image from
  40.  
  41. (procedure P_CreateImage
  42.   (message
  43.     (cat
  44.     "\nInsert \"" #CI_diskname "\" into drive " #CI_drive " !\n\n"
  45.     "(make sure it's the right disk because it will not be checked)"
  46.     )
  47.   )
  48.   (if
  49.     (>= #CI_skiptrk 0)
  50.     (set #option (cat " SKIPTRACK=" #CI_skiptrk))
  51.     (set #option "")
  52.   )
  53.   (if
  54.     (= 0
  55.       (run 
  56.         (cat
  57.           "cd \"" #dest "\"\n"
  58.           "DIC " #CI_drive " FD=" #CI_disknum " LD=" #CI_disknum " SIZE="
  59.           #CI_disklen #option " PEDANTIC >CON:///1000//CLOSE"
  60.         )
  61.       )
  62.     )
  63.     (run ("FileNote %s Quiet" #CI_diskname))
  64.     (abort "\"DIC\" has failed to create a diskimage")
  65.   )
  66. )
  67.  
  68. ;****************************
  69.  
  70. (if
  71.   (exists #readme-file)
  72.   (if
  73.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  74.     ("")
  75.     (run ("SYS:Utilities/More %s" #readme-file))
  76.   )
  77. )
  78.  
  79. (set #program "WHDLoad")
  80. (P_ChkRun)
  81.  
  82. (set #program "DIC")
  83. (P_ChkRun)
  84.  
  85. ; in expert mode ask for source drive
  86. (if
  87.   (= @user-level 2)
  88.   (
  89.     (set #CI_drive
  90.       (askchoice
  91.     (prompt "Select source drive for diskimages")
  92.     (default 0)
  93.     (choices "DF0:" "DF1:" "RAD:" "Enter Device")
  94.     (help @askchoice-help)
  95.       )
  96.     )
  97.     (select #CI_drive
  98.       (set #CI_drive "DF0:")
  99.       (set #CI_drive "DF1:")
  100.       (set #CI_drive "RAD:")
  101.       (set #CI_drive
  102.         (askstring
  103.           (prompt "Select source drive for diskimages")
  104.           (default "DF0:")
  105.           (help @askstring-help)
  106.         )
  107.       )
  108.     )
  109.   )
  110.   (set #CI_drive "DF0:")
  111. )
  112.  
  113. (set @default-dest
  114.   (askdir
  115.     (prompt 
  116.       (cat
  117.     "Where should \"" @app-name "\" installed ?\n"
  118.     "A drawer \"" @app-name "\" will automatically created."
  119.       )
  120.     )
  121.     (help @askdir-help)
  122.     (default @default-dest)
  123.     (disk)
  124.   )
  125. )
  126. (set #dest (tackon @default-dest @app-name))
  127. (if
  128.   (exists #dest)
  129.   (
  130.     (set #choice
  131.       (askbool
  132.         (prompt
  133.           (cat
  134.             "\nDirectory \"" #dest "\" already exists.\n"
  135.             "Should it be deleted?"
  136.           )
  137.         )
  138.         (default 1)
  139.         (choices "Delete" "Skip")
  140.         (help @askbool-help)
  141.       )
  142.     )
  143.     (if
  144.       (= #choice 1)
  145.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  146.     )
  147.   )
  148. )
  149. (makedir #dest
  150.   (help @makedir-help)
  151.   (infos)
  152. )
  153.  
  154. ;----------------------------
  155.  
  156. (copyfiles
  157.   (help @copyfiles-help)
  158.   (source ("%s.Slave" @app-name))
  159.   (dest #dest)
  160. )
  161. (if
  162.   (exists ("%s.newicon" @app-name))
  163.   (set #icon
  164.     (askchoice
  165.       (prompt "\nWhich icon do you like to install ?\n")
  166.       (default 0)
  167.       (choices "Normal" "NewIcon")
  168.       (help @askchoice-help)
  169.     )
  170.   )
  171.   (set #icon 0)
  172. )
  173. (select #icon
  174.   (set #icon ("%s.inf" @app-name))
  175.   (set #icon ("%s.newicon" @app-name))
  176. )
  177. (copyfiles
  178.   (help @copyfiles-help)
  179.   (source #icon)
  180.   (newname ("%s.info" @app-name))
  181.   (dest #dest)
  182. )
  183. (if
  184.   (exists #readme-file)
  185.   (copyfiles
  186.     (help @copyfiles-help)
  187.     (source #readme-file)
  188.     (dest #dest)
  189.   )
  190. )
  191. (if
  192.   (exists ("%s.info" #readme-file))
  193.   (copyfiles
  194.     (help @copyfiles-help)
  195.     (source ("%s.info" #readme-file))
  196.     (dest #dest)
  197.   )
  198. )
  199.  
  200. (P_MakeImages)
  201.  
  202. ;----------------------------
  203.  
  204. (exit)
  205.  
  206.